home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_05 / 1n05063a < prev    next >
Text File  |  1990-05-08  |  460b  |  34 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #ifdef __ZTC__
  6. /*
  7. #define NO_HANDLE 1
  8. */
  9. #include <handle.h>
  10. #else
  11. #define __handle
  12. #define handle_calloc(a)       calloc((a),1)
  13. #endif
  14.  
  15. main()
  16. {
  17.  
  18.     int i;
  19.     void __handle *p;
  20.  
  21.     i=0;
  22.     for ( ; ; )
  23.     {
  24.         printf("%d\r",i++);
  25.         p=handle_calloc(500);
  26.         if ( p == NULL )
  27.             break;
  28.     }
  29.     printf("\nAllocated %d items\n", i);
  30.     printf("Allocated %ld bytes\n", (long) i * 500 );
  31. }
  32.  
  33.  
  34.